<template>
  <div class="index">
    <div class="h-table">
      <el-table-recomponent :tableData="tableData" :props="tableProps">
        <template #operation="{ data }">
          <a href="javascript:;" @click="checkDetail(data)">查看详情</a>
        </template>
      </el-table-recomponent>
    </div>
  </div>
</template>

<script>
import elTableRecomponent from '@/components/elTableRecomponent'
export default {
  name: 'index',
  components: {
    elTableRecomponent
  },
  data () {
    return {
      tableProps: [
        {
          index: 0,
          prop: 'date',
          label: '日期',
          fixw: '150'
        },
        {
          index: 1,
          prop: 'callNum',
          label: '外呼数',
          isFormatter: true
        },
        {
          index: 2,
          prop: 'callSuccess',
          label: '外呼成功数',
          isFormatter: true
        },
        {
          index: 3,
          prop: 'connectNum',
          label: '接通率'
        },
        {
          index: 4,
          prop: 'connectDuring',
          label: '外呼平均通话时长'
        }
      ],
      tableData: [
        { date: '2020-03-04', callNum: 1393, callSuccess: 1093 },
        { date: '2020-03-05', callNum: 3530, callSuccess: 3230 },
        { date: '2020-03-06', callNum: 2923, callSuccess: 2623 },
        { date: '2020-03-07', callNum: 1723, callSuccess: 1423 },
        { date: '2020-03-08', callNum: 3792, callSuccess: 3492 },
        { date: '2020-03-08', callNum: 3792, callSuccess: 3492 },
        { date: '2020-03-08', callNum: 3792, callSuccess: 3492 },
        { date: '2020-03-08', callNum: 3792, callSuccess: 3492 },
        { date: '2020-03-09', callNum: 4593, callSuccess: 4293 }
      ]
    }
  },
  beforeCreate () {},
  created () {},
  beforeMount () {},
  mounted () {},
  beforeUpdate () {},
  updated () {},
  beforeDestroy () {},
  destroyed () {},
  methods: {
    checkDetail (row) {
      console.log('查看详情', row)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
</style>
